package com.qunar.dyds;

import java.util.Date;

import com.qunar.base.meerkat.util.DateUtil;
import com.qunar.base.meerkat.util.PropertyUtil;

/**
 * 系统设置
 * 
 * @author zhongyuan.zhang
 */
public class Setting {

    /** 缓存超时 */
    public static final Integer CACHE_EXPIRE = Integer.valueOf(PropertyUtil.getProperty("system.cache_expire"));

    /** 是否启用缓存 */
    public static final Boolean ENABLE_CACHE = Boolean.valueOf(PropertyUtil.getProperty("system.use_cache"));

    /** 投票限制次数 */
    public static final Integer VOTE_SPAM_LIMIT = Integer.valueOf(PropertyUtil.getProperty("system.vote_spam_limit"));
    /** 投票限制有效时间 */
    public static final Integer VOTE_SPAM_EXPIRE = Integer.valueOf(PropertyUtil.getProperty("system.vote_spam_expire"));

    /** 投票限制次数 */
    public static final Integer UPLOAD_SPAM_LIMIT = Integer.valueOf(PropertyUtil.getProperty("upload.spam_limit"));
    /** 投票限制有效时间 */
    public static final Integer UPLOAD_SPAM_EXPIRE = Integer.valueOf(PropertyUtil.getProperty("upload.spam_expire"));

    /** 投诉限制次数 */
    public static final Integer REPORT_SPAM_LIMIT = Integer.valueOf(PropertyUtil.getProperty("report.spam_limit"));
    /** 投诉限制有效时间 */
    public static final Integer REPORT_SPAM_EXPIRE = Integer.valueOf(PropertyUtil.getProperty("report.spam_expire"));

    /** 头像存储路径 */
    public static final String AVATAR_FOLDER = PropertyUtil.getProperty("upload.avatar_folder");
    public static final String AVATAR_PREFIX =  PropertyUtil.getProperty("upload.avatar_path");

    /** 最大允许上传数据量 */
    public static final Integer UPLOAD_MAX_SIZE = Integer.valueOf(PropertyUtil.getProperty("uplaod.max_size"));

    public static final String SESSION_KEY = "competitor";

    public static final Date VOTE_START_TIME = DateUtil.parse(PropertyUtil.getProperty("vote.start_time"), DateUtil.PATTERN_YYYYMMDDHHMMSS);
    public static final Date VOTE_END_TIME = DateUtil.parse(PropertyUtil.getProperty("vote.end_time"), DateUtil.PATTERN_YYYYMMDDHHMMSS);
}
